package com.link.base.base.reception.mybatis.mapper;

import com.link.base.base.reception.model.*;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.base.base.reception.model.*;

import java.util.List;

/**
 * @author unknown
 * @date unknown
 * @comments 接待-导购助手app使用
 */
public interface ReceptionMapper extends BasicMapper<Reception> {
    /**
     * 根据商机Id获取测量信息
     *
     * @param measureInfo
     * @return 测量信息
     * @throws Exception
     */
    List<MeasureInfo> queryByOptyId(MeasureInfo measureInfo) throws Exception;

    /**
     * 新建一条测量信息
     *
     * @param measureInfo
     * @throws Exception
     */
    void measureInfoInsert(MeasureInfo measureInfo) throws Exception;

    /**
     * 修改测量信息
     *
     * @param measureInfo
     * @throws Exception
     */
    void measureInfoUpdate(MeasureInfo measureInfo) throws Exception;

    /**
     * 删除一条测量信息
     *
     * @param measureInfo
     * @throws Exception
     */
    void deleteMeasureInfoById(MeasureInfo measureInfo) throws Exception;

    /**
     * 根据客户Id获取意向品类
     *
     * @param preferenceProd
     * @return 意向品类
     * @throws Exception
     */
    List<PreferenceProd> queryPrefProdByOptyId(PreferenceProd preferenceProd) throws Exception;

    /**
     * 新建一条意向品类
     *
     * @param preferenceProd
     * @throws Exception
     */
    void preferenceProdInsert(PreferenceProd preferenceProd) throws Exception;

    /**
     * 修改意向品类
     *
     * @param preferenceProd
     * @throws Exception
     */
    void preferenceProdUpdate(PreferenceProd preferenceProd) throws Exception;

    /**
     * 删除一条意向品类
     *
     * @param preferenceProd
     * @throws Exception
     */
    void deletePreferenceProdById(PreferenceProd preferenceProd) throws Exception;

    /**
     * 根据客户Id获取时间进度
     *
     * @param guideSchedule
     * @return 时间进度
     * @throws Exception
     */
    List<GuideSchedule> queryScheduleByOptyId(GuideSchedule guideSchedule) throws Exception;

    /**
     * 新建一条时间进度
     *
     * @param guideSchedule
     * @throws Exception
     */
    void guideScheduleInsert(GuideSchedule guideSchedule) throws Exception;

    /**
     * 修改时间进度
     *
     * @param guideSchedule
     * @throws Exception
     */
    void guideScheduleUpdate(GuideSchedule guideSchedule) throws Exception;

    /**
     * 删除一条时间进度
     *
     * @param guideSchedule
     * @throws Exception
     */
    void deleteScheduleById(GuideSchedule guideSchedule) throws Exception;

    /**
     * 根据Id获取时间进度
     *
     * @param guideSchedule
     * @return 时间进度
     * @throws Exception
     */
    GuideSchedule queryScheduleById(GuideSchedule guideSchedule) throws Exception;

    /**
     * 新建一条意向产品
     *
     * @param intendProd
     * @throws Exception
     */
    void intendProdInsert(OptyIntendProduct intendProd) throws Exception;

    /**
     * 修改意向产品
     *
     * @param intendProd
     * @throws Exception
     */
    void intendProdUpdate(OptyIntendProduct intendProd) throws Exception;

    /**
     * 删除一条意向产品
     *
     * @param intendProd
     * @throws Exception
     */
    void deleteIntendProdById(OptyIntendProduct intendProd) throws Exception;

    /**
     * 根据客户Id获取意向产品
     *
     * @param intendProd
     * @return 意向产品
     * @throws Exception
     */
    List<OptyIntendProduct> queryIntendProdByOptyId(OptyIntendProduct intendProd) throws Exception;

    /**
     * 查询离店原因
     *
     * @param leaveStoreReason
     * @return 离店原因
     * @throws Exception
     */
    List<LeaveStoreReason> queryLeaveStoreReasonList(LeaveStoreReason leaveStoreReason) throws Exception;

    /**
     * 新建离店原因
     *
     * @author LiQun
     * @param record
     * @throws Exception
     * @date 下午8:30 2018/4/26
     */
    void insertLeaveStoreReasons(Reception record) throws Exception;


    /**
     * 查询待接待列表 - 根据门店Id
     *
     * @author LiQun
     * @param reception 接待对象
     * @return 待接待列表
     * @throws Exception 异常信息
     * @date 上午11:55 2018/5/4
     */
    List<WaitReception> queryWaitForReceptionsPage(WaitReception reception) throws Exception;

    /**
     * 查询待接待列表总数 - 根据门店Id
     *
     * @author ouyangzhenqiang
     * @date 2018/11/30
     */
    int queryWaitReceptionListNum(WaitReception reception) throws Exception;

    /**
     * 根据接待头Id查询接待列表 只取匹配度前三客户
     *
     * @author LiQun
     * @param reception 接待头
     * @return 待接待客户列表
     * @throws Exception 一次
     * @date 下午1:59 2018/5/4
     */
    List<WaitReceptionList> queryReceptionListByHeadId(WaitReceptionList reception) throws Exception;
    
    /**
     * 根据接待头Id查询待接待详情
     * 
     * @author ouyangzhenqiang
     * @date 2018/12/1
     * @param reception
     * @return
     * @throws Exception
     */
    WaitReception queryReceptionById(WaitReception reception) throws Exception;

    /**
     * 根据客户Id获取客户的最新接待记录信息
     *
     * @author ouyangzhenqiang
     * @date 2018/12/1
     * @param reception
     * @return
     * @throws Exception
     */
    Reception queryLastReceptionByAccountId(Reception reception) throws Exception;

    /**
     * 根据待接待头Id查询待接待列表匹配度最高的一条记录，并获取其对应person的相关信息
     *
     * @author ouyangzhenqiang
     * @date 2018/12/1
     * @param waitReception
     * @return
     * @throws Exception
     */
    WaitReception queryTopConfidenceAccount(WaitReception waitReception) throws Exception;

}
